#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	char arr[1000];
	gets(arr);
	int sz = strlen(arr);
	for (int i = 0; arr[i]!='\0'; i++)
	{
		int j = 0;
		for (; arr[j] != '\0'; j++)
		{
			if ((arr[i] == arr[j])&& i != j)
			{
				break;
			}
		}
		if (arr[j] == '\0')
		{
			printf("%d\n",i);
			return 1;
		}
	}
	return 0;
}